<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>赞、分享</title>
<style type="text/css">
body,html{
	margin:0;padding:0;
}
</style>
<script type="text/javascript">
document.domain = "qq.com";
function getParamter(name){
    var r = new RegExp("(\\?|#|&)" + name + "=([^&#]*)(&|#|$)");
    var m = location.href.match(r);
    return (!m?"":m[2]);
}
var t = parseInt(getParamter('style')),
g_iStyle = isNaN(t)?3:t;
var w,h,st,icon = false,oldStyle = false;
switch(g_iStyle){
	case 1:
	case 2:
	case 3:
	case 4:
		oldStyle = true;
		break;
	case 101:
		h=24;st=1;
		break;
	case 102:
		h=24;st=2;
		break;
	case 103:
		h=16;st=3;
		break;
	case 201:
		icon = true;
		h=32;st=1;
		break;
	case 202:
		icon = true;
		h=24;st=2;
		break;
	case 203:
		icon = true;
		h=16;st=3;
		break;
	default :
		g_iStyle = 3;
		oldStyle = true;
}

g_sOType = (getParamter('otype')==='share')?'share':'like';
g_sTitle = g_sOType=='share'?'分享到QQ空间':'赞并推荐到QQ空间';
g_sBtn = g_sOType=='share'?'分享':'赞';
g_bShowcount = (getParamter('showcount')=='0')?false:true,
g_bLiked = false, g_iUin = 0, g_bLogined = false, g_sUrl = '',g_iCount = -1;
document.write(['<link rel="stylesheet" rev="stylesheet" href="',!oldStyle?icon?'http://qzonestyle.gtimg.cn/qzone_v6/proj_connect_open/open_share_icon_widget.css':'http://qzonestyle.gtimg.cn/qzone_v6/proj_connect_open/open_share_button_widget.css':'http://qzonestyle.gtimg.cn/qzone_v6/proj_connect_open/open_guanzhu_widget.css','" type="text/css" media="screen" />'].join(''));
</script>
</head>
<body>
<script type="text/javascript">
var htmlStrArr = oldStyle?['<div class="qz_like_mode style_',g_iStyle,'" id="mainContainer"><div id="likePanel" class="qz_like_op"><a href="javascript:void(0);" class="qz_like_bt" id="likeBTN" title="',g_sTitle,'" onclick="form_post();return false;" style="cursor: pointer;"><span id="likeState">',g_sBtn,'</span></a><strong class="qz_like_stat" id="countPanel"><span id="likeCnt" ><a id="count">...</a></span></strong><span class="qz_like_text" id="userName" style="display: none;"></span></div></div>']:icon?['<div class="qz_share_icon qz_share_icon_',h,'"><a class="bt_icon" href="javascript:void(0);" onclick="form_post();return false;" id="likeBTN" title="',g_sTitle,'"><span id="likeState">',g_sBtn,'</span></a><strong class="counts counts_white_',h,'" id="countPanel"><span class="i_left"></span><span class="i_right"><span class="counts_nums" id="count"></span></span></strong></div>']:['<div class="qz_share_btn_blue qz_share_btn_blue_',st,'"><a href="javascript:void(0);" onclick="form_post();return false;" class="bt" id="likeBTN" title="',g_sTitle,'"><span id="likeState">',g_sBtn,'</span></a><strong class="counts counts_white_',h,'" id="countPanel"><span class="i_left"></span><span class="i_right"><span class="counts_nums" id="count">...</span></span></strong></div>'];

document.write(htmlStrArr.join(''));
</script>

<script type="text/javascript">
function $(id){
	return document.getElementById(id);
}
(!g_bShowcount)&&($('countPanel').style.display='none');
function sendPV(url) {
	if(Math.random()+0.05<1){
		return;
	}
	var pvid = (Math.round(Math.random() * 2147483647) * (new Date().getUTCMilliseconds())) % 10000000000;
	var rt = Math.random();
	var src = "	http://pingfore.qq.com/pingd?dm=sns.qzone.qq.com&url=" + url + "&tt=-&rdm=-&rurl=-&pvid=" + pvid + "&scr=-&scl=-&lang=-&java=1&cc=-&pf=-&tz=-8&ct=-&vs=3.3&rt=" + rt;
	window.pgvImg = new Image();
	window.pgvImg.src = src;
}
sendPV(location.pathname+'|rate=1-20'+'|otype='+g_sOType+'|stype='+g_iStyle+'|showcount='+g_bShowcount);
function processNum(num){
	if(typeof num != 'number'){
		num = Number(num);
	}
	var temp = num/10000,
	re;
	if(temp>=1 && temp<1000){
		re = Math.round(num/1000)/10+'万';
	}else if(temp>=1000 && temp<10000){
		re = Math.round(temp)+'万';
	}else if (temp > 10000) {
		re =9999+'万';
	}else {
		re = num;
	}
	return re;
}
function setLike(bLike){
	if(bLike){
		if(g_sOType=='like'){
			$('likeState').innerHTML = '已赞过';
			$('likeBTN').title = '取消赞';
			$('likePanel')&&($('likePanel').className = 'qz_liked_op');
		}
		(g_iCount>=0)&&($('count').innerHTML = processNum(++g_iCount));
	}else{
		if(g_sOType=='like'){
			$('likeState').innerHTML = '赞';
			$('likeBTN').title = '赞并推荐到QQ空间';
			$('likePanel')&&($('likePanel').className = 'qz_like_op');
		}
		(g_iCount>0)&&($('count').innerHTML = processNum(--g_iCount));
	}
	g_bLiked = bLike;
}
g_sUrl = decodeURIComponent(getParamter('url'));
function form_post(){
	if(form_post.fwaiting)return ;//防止连续点击
	form_post.fwaiting = true;
	
	setTimeout('form_post.fwaiting=false;',3000);
	
	if(g_sOType=='share'){
		window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey'+location.search);
		return;
	}
	
	if(g_bLogined){
		var s = document.createElement('script');
		s.charset = 'utf-8';
		s.src = 'http://qzonestyle.gtimg.cn/qzone/app/qzlike/doLike.js';
		document.body.appendChild(s);
	}else{
		window.open('http://qzs.qq.com/qzone/app/qzlike/like_login.html','_blank','toolbar=0,status=0,resizable=1,left='+(window.screen.width - 560) / 2 + ',top=' + ((window.screen.height - 320) / 2-20)+' ,width=560,height=320');
		
	}
	
}
window._Callback = function(o){
	if(o&&o.result){
		g_iCount = o.result.count||0;
		g_bLogined = o.result.login?true:false;
		(g_iCount>=0)&&((o.result.like)?g_iCount--:g_iCount++);//防止刚开始时，g_iCount被setLike改变,当然，只有g_iCount大于等于0（即正常取到赞、分享数时才去设定）
		setLike(o.result.like?true:false,true);
	}
}
if(g_bShowcount){
	document.write(['<script src="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzsharegetlike?url=',encodeURIComponent(g_sUrl),'" charset="utf-8"><\/script>'].join(''));
}
</script>
</body>
</html>